package bt

import "time"

type AnnounceEvent int32

type Request struct {
	InfoHash   	string
	PeerId     	string
	Downloaded 	uint64
	Left       	uint64
	Uploaded   	uint64
	Event      	string
	IPAddress  	string
	IPKey		int
	Key        	string
	NumWant    	int
	Port       	string
	NatMapped	int32


	lastGotQuery    time.Time
	lastGotResponse time.Time

}



type Response struct {
	Interval      int32  `bencode:"interval"`
	Mininterval	  int32  `bencode:"min interval"`
	TrackerId     string `bencode:"tracker id"`
	Complete      int32  `bencode:"complete"`
	Downloaded	  int32  `bencode:"downloaded"`
	Incomplete    int32  `bencode:"incomplete"`
	Peers      	  string `bencode:"peers"`
}

func (e AnnounceEvent) String() string {
	// See BEP 3, "event".
	return []string{"completed", "started", "stopped","empty"}[e]
}
const (
	Completed = iota
	Started
	Stopped
)

const ComplateString   	=  "completed"
const StartString   	=  "started"
const StopString   		=  "stopped"
const ActiveString   	=  "Actived"

